From d7a922d0e14d69a318ee91795b43d16c160a422f Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 7 Aug 2020 12:55:09 -0600 Subject: [PATCH] move linux CI from configure to qmake. (#613) - Add recipe for internal_styles.cc, xcsv_tokens.gperf, gui, unix-gui, toolinfo to GPSBabel.pro. - Add support for text substitution in setup.iss and gbversion.h to GPSBabel.pro. - fix qmake warnings from "qmake -Wall". - split recipes for documents into scripts. - shellcheck fixes for fixdoc, mkcapabilities. - parallel build for coverage. - add INSTALL file with build instructions. - sort document targets into ones for general consumption (gpsbabel.html, gpsbabel.pdf) and one to support www.gpsbabel.org (now gpsbabel.org instead of index.html). --- GPSBabel.pro | 154 ++++++++++++++++++++--------- INSTALL | 64 ++++++++++++ build_and_test | 11 +-- gbversion.h.qmake.in | 17 ++++ gui/setup.iss.in | 0 gui/setup.iss.qmake.in | 87 ++++++++++++++++ tools/fixdoc | 16 +-- tools/make_gpsbabel_html.sh | 13 +++ tools/make_gpsbabel_org.sh | 18 ++++ tools/make_gpsbabel_pdf.sh | 8 ++ tools/mkcapabilities | 6 +- tools/travis_script_linux_coverage | 2 +- 12 files changed, 333 insertions(+), 63 deletions(-) create mode 100644 INSTALL create mode 100644 gbversion.h.qmake.in mode change 100755 => 100644 gui/setup.iss.in create mode 100644 gui/setup.iss.qmake.in create mode 100755 tools/make_gpsbabel_html.sh create mode 100755 tools/make_gpsbabel_org.sh create mode 100755 tools/make_gpsbabel_pdf.sh diff --git a/GPSBabel.pro b/GPSBabel.pro index eab30a4bd..0c21620f8 100644 --- a/GPSBabel.pro +++ b/GPSBabel.pro @@ -25,8 +25,37 @@ CONFIG += link_pkgconfig TEMPLATE = app +# use GB variable to express ownership intention and +# avoid conflict with documented and undocumented qmake variables +GB.VERSION_COMPONENTS = $$split(VERSION, .) +GB.MAJOR = $$member(GB.VERSION_COMPONENTS, 0) +GB.MINOR = $$member(GB.VERSION_COMPONENTS, 1) +GB.MICRO = $$member(GB.VERSION_COMPONENTS, 2) +# Increase GB.BUILD for a new release (why? Where is this ever used?) +# A: it's used by win32/gpsbabel.rc which includes gbversion.h +GB.BUILD = 31 +# GB.PACKAGE_RELEASE = "-beta20190413" + +# may be overwridden on qmake command line +!defined(DOCVERSION, var) { + DOCVERSION=$${VERSION} +} + +# may be overwridden on qmake command line +!defined(WEB, var) { + WEB = ../babelweb +} + +# use undocumented QMAKE_SUBSTITUTES variable to emulate AC_CONFIG_FILES +GB.versionfile.input = gbversion.h.qmake.in +GB.versionfile.output = gbversion.h +QMAKE_SUBSTITUTES += GB.versionfile +GB.setupfile.input = gui/setup.iss.qmake.in +GB.setupfile.output = gui/setup.iss +QMAKE_SUBSTITUTES += GB.setupfile + MINIMAL_FMTS = magproto.cc explorist_ini.cc gpx.cc geo.cc mapsend.cc garmin.cc \ - garmin_device_xml.cc garmin_tables.cc internal_styles.cc nmea.cc \ + garmin_device_xml.cc garmin_tables.cc nmea.cc \ kml.cc wbt-200.cc ALL_FMTS=$$MINIMAL_FMTS gtm.cc gpsutil.cc pcx.cc \ @@ -61,7 +90,7 @@ FILTERS=position.cc radius.cc duplicate.cc arcdist.cc polygon.cc smplrout.cc \ nukedata.cc interpolate.cc transform.cc height.cc swapdata.cc bend.cc \ validate.cc FILTER_HEADERS = $$FILTERS -FILTER_HEADERS ~= s/\.cc/.h/g +FILTER_HEADERS ~= s/\\.cc/.h/g JEEPS += jeeps/gpsapp.cc jeeps/gpscom.cc \ jeeps/gpsmath.cc jeeps/gpsmem.cc \ @@ -161,6 +190,47 @@ HEADERS = \ HEADERS += $$FILTER_HEADERS +win32-msvc* { + # avoid attempts by cmd.exe to execute mkstyle.sh + SOURCES += internal_styles.cc +} else { + # It would be nice to do this when make runs instead of qmake, but we will + # monitor the style directory to catch new or deleted .style files. + STYLE_FILES = $$files($${PWD}/style/*.style) + # It's a bit tacky, but this may modify source files when doing an out of source build. + # The root of this is that internal_styles.cc is checked in as it can't be built on all platforms, + # and we want to make sure it is up to date on commit. + styles.commands += $${PWD}/mkstyle.sh > $${PWD}/internal_styles.cc || (rm -f $${PWD}/internal_styles.cc ; exit 1) + styles.CONFIG += combine no_clean + styles.depends += $${PWD}/mkstyle.sh + styles.depends += $${PWD}/style # this catches the creation/deletion of a style file. + styles.input = STYLE_FILES + styles.output = $${PWD}/internal_styles.cc + styles.variable_out = SOURCES + QMAKE_EXTRA_COMPILERS += styles +} + +win32-msvc* { + # assume gperf not available. + HEADERS += xcsv_tokens.gperf +} else { + TOKEN_FILES = $${PWD}/xcsv_tokens.in + equals(PWD, $${OUT_PWD}) { + tokens.commands += gperf --output-file=xcsv_tokens.gperf -L C++ -D -t xcsv_tokens.in + } else { + # Require in source builds. + # The the output must be checked in and the output depends on + # the --output-file parameter and the input file. + tokens.commands += echo "compilation of xcsv_tokens is not supported for out of source builds."; + tokens.commands += exit 1; + } + tokens.CONFIG += no_link no_clean + tokens.input = TOKEN_FILES + tokens.output = $${PWD}/xcsv_tokens.gperf + tokens.variable_out = HEADERS + QMAKE_EXTRA_COMPILERS += tokens +} + load(configure) CONFIG(release, debug|release): DEFINES *= NDEBUG @@ -228,7 +298,7 @@ QMAKE_CLEAN += $${OUT_PWD}/testo.d/*.vglog # build the compilation data base used by clang tools including clang-tidy. macx|linux|openbsd{ compile_command_database.target = compile_commands.json - compile_command_database.commands = make clean; bear make + compile_command_database.commands = $(MAKE) clean; bear $(MAKE) QMAKE_EXTRA_TARGETS += compile_command_database } @@ -249,7 +319,7 @@ QMAKE_EXTRA_TARGETS += clang-tidy # dependencies: # extra ubuntu bionic packages: gcovr lcov linux{ - coverage.commands = make clean; + coverage.commands = $(MAKE) clean; coverage.commands += rm -f gpsbabel_coverage.xml; coverage.commands += $(MAKE) CFLAGS=\"$(CFLAGS) -fprofile-arcs -ftest-coverage\" CXXFLAGS=\"$(CXXFLAGS) -fprofile-arcs -ftest-coverage\" LFLAGS=\"$(LFLAGS) --coverage\" && coverage.commands += ./testo && @@ -263,28 +333,16 @@ linux{ cppcheck.commands = cppcheck --enable=all --force --config-exclude=zlib --config-exclude=shapelib $(INCPATH) $$ALL_FMTS $$FILTERS $$SUPPORT $$JEEPS QMAKE_EXTRA_TARGETS += cppcheck -!defined(WEB, var) { - WEB = ../babelweb -} -!defined(DOCVERSION, var) { - DOCVERSION=$${VERSION} +gpsbabel.org.depends = gpsbabel gpsbabel.pdf FORCE +equals(PWD, $${OUT_PWD}) { + gpsbabel.org.commands += web=\$\${WEB:-$${WEB}}; + gpsbabel.org.commands += docversion=\$\${DOCVERSION:-$${DOCVERSION}}; + gpsbabel.org.commands += tools/make_gpsbabel_org.sh \"\$\${web}\" \"\$\${docversion}\"; +} else { + gpsbabel.org.commands += echo "target gpsbabel.org is not supported for out of source builds."; + gpsbabel.org.commands += exit 1; } - -index.html.depends = gpsbabel FORCE -index.html.commands += web=\$\${WEB:-$${WEB}} && -index.html.commands += docversion=\$\${DOCVERSION:-$${DOCVERSION}} && -index.html.commands += mkdir -p \$\${web}/htmldoc-\$\${docversion} && -index.html.commands += perl xmldoc/makedoc && -index.html.commands += xmlwf xmldoc/readme.xml && #check for well-formedness -index.html.commands += xmllint --noout --valid xmldoc/readme.xml && #validate -index.html.commands += xsltproc \ - --stringparam base.dir "\$\${web}/htmldoc-\$\${docversion}/" \ - --stringparam root.filename "index" \ - xmldoc/babelmain.xsl \ - xmldoc/readme.xml && -index.html.commands += tools/fixdoc \$\${web}/htmldoc-\$\${docversion} "GPSBabel \$\${docversion}:" && -index.html.commands += tools/mkcapabilities \$\${web} \$\${web}/htmldoc-\$\${docversion} -QMAKE_EXTRA_TARGETS += index.html +QMAKE_EXTRA_TARGETS += gpsbabel.org # # The gpsbabel.pdf target depends on additional tools. @@ -307,28 +365,34 @@ QMAKE_EXTRA_TARGETS += index.html # gpsbabel.html.depends = gpsbabel FORCE -gpsbabel.html.commands += perl xmldoc/makedoc && -gpsbabel.html.commands += xsltproc \ - --output gpsbabel.html \ - --stringparam toc.section.depth "1" \ - --stringparam html.cleanup "1" \ - --stringparam make.clean.html "1" \ - --stringparam html.valid.html "1" \ - --stringparam html.stylesheet \ - "https://www.gpsbabel.org/style3.css" \ - http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \ - xmldoc/readme.xml +equals(PWD, $${OUT_PWD}) { + gpsbabel.html.commands += tools/make_gpsbabel_html.sh +} else { + gpsbabel.html.commands += echo "target gpsbabel.html is not supported for out of source builds."; + gpsbabel.html.commands += exit 1; +} QMAKE_EXTRA_TARGETS += gpsbabel.html gpsbabel.pdf.depends = gpsbabel FORCE -gpsbabel.pdf.commands += web=\$\${WEB:-$${WEB}} && -gpsbabel.pdf.commands += docversion=\$\${DOCVERSION:-$${DOCVERSION}} && -gpsbabel.pdf.commands += perl xmldoc/makedoc && -gpsbabel.pdf.commands += xmlwf xmldoc/readme.xml && #check for well-formedness -gpsbabel.pdf.commands += xmllint --noout --valid xmldoc/readme.xml && #validate -gpsbabel.pdf.commands += xsltproc -o gpsbabel.fo xmldoc/babelpdf.xsl xmldoc/readme.xml && -gpsbabel.pdf.commands += HOME=. fop -q -fo gpsbabel.fo -pdf gpsbabel.pdf && -gpsbabel.pdf.commands += mkdir -p \$\${web}/htmldoc-\$\${docversion} && -gpsbabel.pdf.commands += cp gpsbabel.pdf \$\${web}/htmldoc-\$\${docversion}/gpsbabel-\$\${docversion}.pdf +equals(PWD, $${OUT_PWD}) { + gpsbabel.pdf.commands += tools/make_gpsbabel_pdf.sh +} else { + gpsbabel.pdf.commands += echo "target gpsbabel.pdf is not supported for out of source builds."; + gpsbabel.pdf.commands += exit 1; +} QMAKE_EXTRA_TARGETS += gpsbabel.pdf +gui.depends = $(TARGET) FORCE +gui.commands += cd gui; $(QMAKE) app.pro && $(MAKE) +QMAKE_EXTRA_TARGETS += gui + +unix-gui.depends = gui FORCE +unix-gui.commands += cd gui; $(MAKE) package +QMAKE_EXTRA_TARGETS += unix-gui + +toolinfo.depends = FORCE +toolinfo.commands += $(CC) --version; +toolinfo.commands += $(CXX) --version; +toolinfo.commands += $(QMAKE) -v; +QMAKE_EXTRA_TARGETS += toolinfo + diff --git a/INSTALL b/INSTALL new file mode 100644 index 000000000..974c56d85 --- /dev/null +++ b/INSTALL @@ -0,0 +1,64 @@ +The use of the autotools based build system (configure) is deprecated and may +be removed in a future release! + +The use of cmake is experimental. The implementation is not complete. It is +untested by continuous integration. It is not recommended for production use. + +The recommended build uses Qt's qmake: + +The following options may be set on the qmake command line. + +WITH_LIBUSB=no|pkgconfig|system*|included*|custom + note that libusb is NOT used on windows. + no: build without libusb-1.0. functionality will be limited. + pkgconfig: build with libusb-1.0 found by pkg-config. + system: build with libusb-1.0 found on system library path and under + libusb-1.0 on system include path (default, linux, openbsd). + included: build with libusb-1.0 included with gpsbabel (default, macOS only). + custom: build with user supplied libusb-1.0. LIBS and INCLUDEPATH may need to + be set, e.g. LIBS+=... INCLUDEPATH+=... + +WITH_SHAPELIB=no|pkgconfig|included*|custom + no: build without shapelib. functionality will be limited. + pkgconfig: build with shapelib found by pkg-config. + included: build with shapelib included with gpsbabel (default). + custom: build with user supplied shapelib. LIBS and INCLUDEPATH may need to + be set, e.g. LIBS+=... INCLUDEPATH+=... + +WITH_ZLIB=no|pkgconfig|included*|custom + no: build without zlib. functionality will be limited. + pkgconfig: build with zlib found by pkg-config. + included: build with zlib included with gpsbabel (default). + custom: build with user supplied zlib. LIBS and INCLUDEPATH may need to be + set, e.g. LIBS+=... INCLUDEPATH+=... + +DOCVERSION=... + string appended to documentation location for www.gpsbabel.org. The default + value is the version string, e.g. "1.7.0". This is used by the gpsbabel.org + target, you are unlikely to need it unless you are maintaining + www.gpsbabel.org. +WEB=DIR + Path where the documentation will be stored for www.gpsbabel.org. This is + used by the gpsbabel.org target, you are unlikely to need it unless you are + maintaining www.gpsbabel.org. The default location is "../babelweb" + +Make targets: + +check: Run the basic test suite. +check-vtesto: Run valgrind memcheck. +gpsbabel: Build the command line tool. +gpsbabel.hmtl: Create the html documentation. +gpsbabel.org: Create documentation for use on www.gpsbabel.org. +gpsbabel.pdf: Create the pdf documentation. +gui: Build the graphical user interface. +unix-gui: Build the graphical user interface and collect the components for + distribution. On Linux the gpsbabel generated components will be under + gui/GPSBabelFE, any dynamically linked required libraries are not included. + On macOS an app bundle will be created at gui/GPSBabelFE.app and an apple disk + image will be created at gui/GPSBabelFE.dmg. + +Windows builds: + Two build methods are supported with MSVC tools. + 1. "qmake -tp vc" will create a visual studio project that can be built with msbuild. + 2. "qmake" will create a Makefile that can be built with nmake. + diff --git a/build_and_test b/build_and_test index b2fe52478..64afebd07 100755 --- a/build_and_test +++ b/build_and_test @@ -17,23 +17,22 @@ git --no-pager log -n 1 # some of our targets are part of the svn repository to allow a # minimal set of build tools to be used. # touch these targets to make sure they aren't considered out of date. -touch configure touch xcsv_tokens.gperf touch internal_styles.cc # build and test keeping output within the pwd. export GBTEMP=$(pwd)/gbtemp mkdir -p $GBTEMP -./configure --with-doc=$(pwd)/gpsbabel_docdir +qmake WEB=$(pwd)/gpsbabel_docdir # As of 2018-10, all the virtualized travis build images are two cores per: # https://docs.travis-ci.com/user/reference/overview/ # We'll be slightly abusive on CPU knowing that I/O is virtualized. -export MAKEFLAGS=-j3 make toolinfo make clean -make -make linux-gui -make doc +make -j 3 +make -j 3 unix-gui make gpsbabel.html +make gpsbabel.pdf +make gpsbabel.org make check # test for mangled encoding of command line arguments ./test_encoding_latin1 diff --git a/gbversion.h.qmake.in b/gbversion.h.qmake.in new file mode 100644 index 000000000..ead3c6199 --- /dev/null +++ b/gbversion.h.qmake.in @@ -0,0 +1,17 @@ +/* + * gbversion.h is generated from gbversion.h.in which uses autoconf voodoo + * to get the version number from configure.ac. + * + * Isn\'t simplification via automation grand? + */ +#ifdef RC_INVOKED +// These defines are for the Microsoft resource compiler scripts +// win32/gpsbabel.rc and gui/app.rc +#define VER_FILE $${GB.MAJOR},$${GB.MINOR},$${GB.MICRO},$${GB.BUILD} +#define VER_PRODUCT $${GB.MAJOR},$${GB.MINOR},$${GB.MICRO},$${GB.BUILD} +#define VER_FILE_STR \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\" +#define VER_PRODUCT_STR \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\" +#else +#define VERSION \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\" +#define WEB_DOC_DIR \"https://www.gpsbabel.org/htmldoc-$${DOCVERSION}\" +#endif diff --git a/gui/setup.iss.in b/gui/setup.iss.in old mode 100755 new mode 100644 diff --git a/gui/setup.iss.qmake.in b/gui/setup.iss.qmake.in new file mode 100644 index 000000000..5585a8de1 --- /dev/null +++ b/gui/setup.iss.qmake.in @@ -0,0 +1,87 @@ +; +; NOTE: setup.iss is generated from setup.iss.in via configure. +; The generated setup.iss is checked in to help keep the version numbers +; synchronized. +; +; Script for generating installation setup program for GPSBabel +; Uses the Inno setup compiler. +; windeployqt should be run to prepare the necessary Qt files before +; running Inno Setup. +#ifndef gui_build_dir_name + #define gui_build_dir_name \"build-app-Desktop_Qt_5_5_1_MinGW_32bit-Release\" +#endif +#ifndef gpsbabel_build_dir_name + #define gpsbabel_build_dir_name \"build-GPSBabel-Desktop_Qt_5_5_1_MinGW_32bit-Release\" +#endif + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017} +AppName=GPSBabel +AppVerName=GPSBabel $${VERSION}$${GB.PACKAGE_RELEASE} +AppPublisher=GPSBabel +AppPublisherURL=https://www.gpsbabel.org +AppSupportURL=https://www.gpsbabel.org +AppUpdatesURL=https://www.gpsbabel.org +DefaultDirName={pf}\\GPSBabel +DefaultGroupName=GPSBabel +OutputDir=release +OutputBaseFilename=GPSBabel-$${VERSION}$${GB.PACKAGE_RELEASE}-Setup +OutputManifestFile=GPSBabel-$${VERSION}$${GB.PACKAGE_RELEASE}-Manifest.txt +SetupIconFile=images\\babel2.ico +Compression=lzma +SolidCompression=yes +LicenseFile=COPYING.txt + +[Languages] +Name: \"english\"; MessagesFile: \"compiler:Default.isl\" + +[Tasks] +Name: \"desktopicon\"; Description: \"{cm:CreateDesktopIcon}\"; GroupDescription: \"{cm:AdditionalIcons}\"; Flags: unchecked + +[Files] +Source: gmapbase.html; DestDir: \"{app}\"; Flags: ignoreversion +Source: qt.conf; DestDir: \"{app}\"; Flags: ignoreversion + +Source: \"..\\{#gui_build_dir_name}\\release\\*\"; Excludes: \"app.res,vcredist_*.exe,*.cpp,*.h,*.o,*.obj\"; DestDir: \"{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: \"..\\{#gui_build_dir_name}\\release\\vcredist_x86.exe\"; DestDir: \"{app}\"; Flags: ignoreversion skipifsourcedoesntexist deleteafterinstall +Source: \"..\\{#gui_build_dir_name}\\release\\vcredist_x64.exe\"; DestDir: \"{app}\"; Flags: ignoreversion skipifsourcedoesntexist deleteafterinstall +Source: \"..\\..\\{#gpsbabel_build_dir_name}\\release\\gpsbabel.exe\"; DestDir: \"{app}\"; Flags: ignoreversion +; Source: release\\help\\*; DestDir: \"{app}\\help\"; Flags: ignoreversion recursesubdirs createallsubdirs + +; Translation strings extracted from source code. Include it in the dist +; so that users can translate if they want to. +; Source: gpsbabel_*.ts; DestDir: \"{app}\\translations\"; Flags: ignoreversion +; Source: gpsbabelfe_*.ts; DestDir: \"{app}\\translations\"; Flags: ignoreversion + +; Compiled translation strings that are used at runtime. +Source: coretool\\gpsbabel_*.qm; DestDir: \"{app}\\translations\"; Flags: ignoreversion +Source: gpsbabelfe_*.qm; DestDir: \"{app}\\translations\"; Flags: ignoreversion + +; Miscellaneous +Source: COPYING.txt; DestDir: {app}; Flags: ignoreversion +; Source: AUTHORS; DestDir: {app}; Flags: ignoreversion +; Source: README.contrib; DestDir: {app}; Flags: ignoreversion +; Source: README.gui; DestDir: {app}; Flags: ignoreversion + + +; NOTE: Don\'t use \"Flags: ignoreversion\" on any shared system files + +[Icons] +Name: \"{group}\\GPSBabel\"; Filename: \"{app}\\gpsbabelfe.exe\" +Name: \"{commondesktop}\\GPSBabel\"; Filename: \"{app}\\gpsbabelfe.exe\"; Tasks: desktopicon + +[Run] +Filename: \"{app}\\vcredist_x86.exe\"; Parameters: \"/quiet\"; Flags: skipifdoesntexist +Filename: \"{app}\\vcredist_x64.exe\"; Parameters: \"/quiet\"; Flags: skipifdoesntexist +Filename: \"{app}\\gpsbabelfe.exe\"; Description: \"{cm:LaunchProgram,GPSBabelFE}\"; Flags: nowait postinstall skipifsilent + +[Registry] +Root: HKCU; Subkey: \"Software\\GPSBabel\"; Flags: uninsdeletekeyifempty +Root: HKCU; Subkey: \"Software\\GPSBabel\\GPSBabel\"; Flags: uninsdeletekey +Root: HKCU; Subkey: \"Software\\GPSBabel\\GPSBabelFE\"; Flags: uninsdeletekey + +; ISPP preprocessor output can be useful for debug +#expr SaveToFile(\"PreprocessedScript.iss\") diff --git a/tools/fixdoc b/tools/fixdoc index c72d1d4c7..4b10980de 100755 --- a/tools/fixdoc +++ b/tools/fixdoc @@ -1,4 +1,4 @@ -#/bin/sh +#!/bin/sh # set -e @@ -11,17 +11,17 @@ DIR=$1 TITLE=$2 -SED=sed +SED="sed" # MacOS using Homebrew [ -f /usr/local/bin/gsed ] && SED=/usr/local/bin/gsed [ -f /opt/local/bin/gsed ] && SED=/opt/local/bin/gsed -[ ! -d $DIR/tpl ] && mkdir -p $DIR/tpl +[ ! -d "$DIR/tpl" ] && mkdir -p "$DIR/tpl" -for f in $DIR/*.html +for f in "$DIR"/*.html do - base=$(echo $f | sed "s/.html$//") + base=$(echo "$f" | sed "s/.html$//") $SED -i \ -e '/^.*#{/block}#' \ -e '/^ ${base}.html << EOF + "$f" + mv "${base}.html" "$(dirname "$base")/tpl/$(basename "$f" .html).tpl" + cat > "${base}.html" << EOF display(\$template); diff --git a/tools/make_gpsbabel_html.sh b/tools/make_gpsbabel_html.sh new file mode 100755 index 000000000..4f4e66425 --- /dev/null +++ b/tools/make_gpsbabel_html.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -ex + +perl xmldoc/makedoc +xsltproc \ + --output gpsbabel.html \ + --stringparam toc.section.depth "1" \ + --stringparam html.cleanup "1" \ + --stringparam make.clean.html "1" \ + --stringparam html.valid.html "1" \ + --stringparam html.stylesheet "https://www.gpsbabel.org/style3.css" \ + http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \ + xmldoc/readme.xml diff --git a/tools/make_gpsbabel_org.sh b/tools/make_gpsbabel_org.sh new file mode 100755 index 000000000..f19b45c40 --- /dev/null +++ b/tools/make_gpsbabel_org.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -ex + +web=$1 +docversion=$2 + +mkdir -p "${web}/htmldoc-${docversion}" +perl xmldoc/makedoc +xmlwf xmldoc/readme.xml #check for well-formedness +xmllint --noout --valid xmldoc/readme.xml #validate +xsltproc \ + --stringparam base.dir "${web}/htmldoc-${docversion}/" \ + --stringparam root.filename "index" \ + xmldoc/babelmain.xsl \ + xmldoc/readme.xml +tools/fixdoc "${web}/htmldoc-${docversion}" "GPSBabel ${docversion}:" +tools/mkcapabilities "${web}" "${web}/htmldoc-${docversion}" +cp gpsbabel.pdf "${web}/htmldoc-${docversion}/gpsbabel-${docversion}.pdf" diff --git a/tools/make_gpsbabel_pdf.sh b/tools/make_gpsbabel_pdf.sh new file mode 100755 index 000000000..e420c53c4 --- /dev/null +++ b/tools/make_gpsbabel_pdf.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -ex + +perl xmldoc/makedoc +xmlwf xmldoc/readme.xml #check for well-formedness +xmllint --noout --valid xmldoc/readme.xml #validate +xsltproc -o gpsbabel.fo xmldoc/babelpdf.xsl xmldoc/readme.xml +HOME=. fop -q -fo gpsbabel.fo -pdf gpsbabel.pdf diff --git a/tools/mkcapabilities b/tools/mkcapabilities index 63a20eb7b..48351b93d 100755 --- a/tools/mkcapabilities +++ b/tools/mkcapabilities @@ -21,12 +21,12 @@ function getcap(type, cap, sname, lname) { } getcap($1, $2, $3, $5) -' > ${capabilitiesdir}/capabilities.inc +' > "${capabilitiesdir}/capabilities.inc" -FMTS=`./gpsbabel -^2 | grep -v '^internal' | sed 's/\&/\&/' | awk -F'\t' '{print $3}'` +FMTS=$(./gpsbabel -^2 | grep -v '^internal' | sed 's/\&/\&/' | awk -F'\t' '{print $3}') for f in $FMTS do - [ ! -f ${htmldocdir}/fmt_${f}.html ] && echo Missing doc for $f + [ ! -f "${htmldocdir}/fmt_${f}.html" ] && echo Missing doc for "$f" done exit 0 diff --git a/tools/travis_script_linux_coverage b/tools/travis_script_linux_coverage index eef83171a..925b6972a 100755 --- a/tools/travis_script_linux_coverage +++ b/tools/travis_script_linux_coverage @@ -7,7 +7,7 @@ # as of 3/16/2019 with coverage reporter 4.0.3 java 8 is not required. qmake -make coverage +make -j 3 coverage # debug tokens "$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"/ci_tokens -- 2.30.2